import { createRouter, createWebHistory } from 'vue-router'
import homeView from '@/views/home/home.vue'
import indexView from '@/views/home/index.vue'
import categoriesView from '@/views/home/categories.vue'
import detailView from '@/views/home/detail.vue'
import getOrderView from '@/views/home/getOrder.vue'
import zfView from '@/views/home/zf.vue'
import zfjgView from '@/views/home/zfjg.vue'
import goodsView from '@/views/home/goods.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/', redirect: '/home/index' },
    { path: '/home', name: 'home', component: homeView,children:[
    { path: 'index', name: 'index', component: indexView, },
    { path: 'categories', name: 'categories', component: categoriesView, },
    { path: 'detail/:goods_id', name: 'detail', component: detailView, },
    { path: 'getOrder', name: 'getOrder', component: getOrderView, },
    { path: 'zf', name: 'zf', component: zfView, },
    { path: 'zfjg', name: 'zfjg', component: zfjgView, },
    { path: 'goods/:query', name: 'goods', component: goodsView, },
    ] },

  ],
})

export default router
